package com.shuma.user.service.impl;

import com.alipay.sofa.runtime.api.annotation.SofaService;
import com.alipay.sofa.runtime.api.annotation.SofaServiceBinding;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.shuma.user.mapper.UserMapper;
import com.shuma.user.pojo.User;
import com.shuma.user.service.UserProxyRpc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
//@SofaService(interfaceType = UserProxyRpc.class, uniqueId = "${service.unique.id}", bindings = { @SofaServiceBinding(bindingType = "bolt") })
public class UserProxyRpcImpl implements com.shuma.user.service.UserProxyRpc {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User search(String username) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);
        User user = userMapper.selectOne(queryWrapper);
        return user;
    }
}
